<?php
/*
 * Created on 2008-5-9
 *
 * File:news.php
 * Author:David Meng
 * Site:http://www.systn.com
 * Email:mdchinese@gmail.com
 *
 */
	
	//编辑新闻
	$subject	= '系统设置';
	$page_title = $subject.' -  修改';
	$type		= $action;
	$form_src	= 'action='.$action.'&todo=update';
	$from_button= true;		//显示编辑按钮
	
		//添加数据
		if($todo=='update'){

			$error = post_check(
				array(
					array(
						'name'=>'网站名称',
						'data'=>$set_sitename
					),
					array(
						'name'=>'网站地址',
						'data'=>$set_siteurl
					),
					array(
						'name'=>'上传图片地址',
						'data'=>$set_attach_dir
					),
				)
			);


			//没有错误则写入数据
			if(!$error){
				
				$data = array(
					'sitename'	=>$set_sitename,
					'siteurl'	=>$set_siteurl,
					'attach_dir'=>$set_attach_dir,
					
					'mail_server'=>$set_mail_server,
					'mail_name' =>$set_mail_name,
					'mail_from' =>$set_mail_from,
					'mail_user'	=>$set_mail_user,
					'mail_pass'	=>$set_mail_pass,
				);
				
				//编辑资料
					if ($oSys->update($data)){
						
						msg('恭喜，操作数据成功!',$sys_page."?model=$model&action=$action",3);
					}else {
						msg('操作数据失败!');
					}
				
			}else{
				msg('操作数据失败!');
			}
		}
	
	//获得资料
	$info		= $oSys->getInfo($type);
	
	$tpl->set_file('sys_set');
	$fpage = $tpl->r();
?>